summaryrefslogtreecommitdiff
path: root/ldmicro/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'ldmicro/CMakeLists.txt')
-rw-r--r--ldmicro/CMakeLists.txt41
1 files changed, 34 insertions, 7 deletions
diff --git a/ldmicro/CMakeLists.txt b/ldmicro/CMakeLists.txt
index 7abcaad..0e5dee5 100644
--- a/ldmicro/CMakeLists.txt
+++ b/ldmicro/CMakeLists.txt
@@ -13,15 +13,18 @@ IF (MSVC)
ENDIF (MSVC)
IF(UNIX)
+ MESSAGE( STATUS "Initializing.." )
add_definitions(-D__UNIX__)
+ add_definitions(-DLDLANG_EN)
+ # set_property(DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_SOURCE_DIR}/build/")
MESSAGE( STATUS "Performing system check.." )
MESSAGE( STATUS "Identifing bitness of the platform.." )
- add_definitions(-D__UNIX32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_definitions(-D__UNIX64)
MESSAGE( STATUS "Bitness of the platform: " 64)
else()
+ add_definitions(-D__UNIX32)
MESSAGE( STATUS "Bitness of the platform: " 36)
endif()
MESSAGE( STATUS "Performing system check - done" )
@@ -30,6 +33,29 @@ IF(UNIX)
find_package (PkgConfig REQUIRED)
pkg_check_modules (GTK3 REQUIRED gtk+-3.0)
+ ## Set object dir
+ set(OBJDIR ${CMAKE_CURRENT_SOURCE_DIR}/obj)
+
+ ## Set perl scripts to be run before build to generate files needed
+ MESSAGE( STATUS "Adding perl scripts to build.." )
+
+ add_custom_command(
+ OUTPUT ${OBJDIR}/lang-tables.h
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/lang-tables.pl > ${OBJDIR}/lang-tables.h
+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/lang-*.txt")
+
+ add_custom_command(
+ OUTPUT ${OBJDIR}/helptext.cpp
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND perl txt2c.pl > ${OBJDIR}/helptext.cpp
+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/manual*.txt")
+
+ set(SCRIPT_GENERATED_FILES ${OBJDIR}/helptext.cpp
+ ${OBJDIR}/lang-tables.h)
+
+ add_custom_target(LDMicro_SCRIPT_GENERATED_FILES DEPENDS ${SCRIPT_GENERATED_FILES})
+
## Version control
set (LDMicro_VERSION_MAJOR 1)
set (LDMicro_VERSION_MINOR 0)
@@ -39,12 +65,13 @@ IF(UNIX)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/lib/linuxUI")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/lib/freezeLD")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/includes")
+ # include_directories("${OBJDIR}")
set(PROJECT_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/includes")
CONFIGURE_FILE (
"${PROJECT_INCLUDE_DIR}/ldmicroVC.h.in"
"${PROJECT_INCLUDE_DIR}/ldmicroVC.h"
)
- MESSAGE ( STATUS " PROJECT_INCLUDE_DIR: " ${PROJECT_INCLUDE_DIR} )
+ # MESSAGE ( STATUS " PROJECT_INCLUDE_DIR: " ${PROJECT_INCLUDE_DIR} )
## Add GTK3 include files if GTK3 is found
IF ( GTK3_FOUND )
@@ -52,8 +79,8 @@ IF(UNIX)
link_directories (${GTK3_LIBRARY_DIRS})
add_definitions (${GTK3_CFLAGS_OTHER})
link_libraries (${GTK3_LIBRARIES})
- MESSAGE ( STATUS " GTK3_INCLUDE_DIR: " ${GTK3_INCLUDE_DIRS} )
- MESSAGE ( STATUS " GTK3_LIBRARIES: " ${GTK3_LIBRARIES} )
+ # MESSAGE( STATUS " GTK3_INCLUDE_DIR: " ${GTK3_INCLUDE_DIRS} )
+ # MESSAGE( STATUS " GTK3_LIBRARIES: " ${GTK3_LIBRARIES} )
ENDIF ( GTK3_FOUND )
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/lib/linuxUI")
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/lib/freezeLD")
@@ -84,14 +111,14 @@ IF(UNIX)
draw_outputdev.cpp
draw.cpp
schematic.cpp
+ ${OBJDIR}/helptext.cpp
helpdialog.cpp
maincontrols.cpp
ldmicro.cpp)
add_executable (LDMicro ${COMPILE_CPP_SOURCES})
+ add_dependencies(LDMicro LDMicro_SCRIPT_GENERATED_FILES)
install (TARGETS LDMicro DESTINATION bin)
target_link_libraries (LDMicro LinuxUI)
target_link_libraries (LDMicro FreezeLD)
- #add_executable (testMain testMain.cpp)
- #install (TARGETS testMain DESTINATION bin)
-ENDIF(UNIX)
+ENDIF(UNIX) \ No newline at end of file