CMakeLists.txt

changeset 135
8b9132fea327
parent 120
5ea0faefa82a
child 136
1c40bb4f8221
--- a/CMakeLists.txt	Sun Jul 20 17:25:36 2014 +0300
+++ b/CMakeLists.txt	Mon Jul 21 17:14:42 2014 +0300
@@ -14,7 +14,7 @@
 	src/main.h
 	src/parser.h
 	src/property.h
-	src/string.h
+	src/stringClass.h
 	src/stringTable.h
 	src/tokens.h
 	src/types.h
@@ -30,31 +30,36 @@
 	src/lexerScanner.cpp
 	src/main.cpp
 	src/parser.cpp
-	src/string.cpp
+	src/stringClass.cpp
 	src/stringTable.cpp
 )
 
 add_subdirectory (updaterevision)
 add_subdirectory (namedenums)
-
 get_target_property (UPDATEREVISION_EXE updaterevision LOCATION)
+get_target_property (NAMEDENUMS_EXE namedenums LOCATION)
 
 add_custom_target (revision_check ALL
-    COMMAND ${UPDATEREVISION_EXE} src/gitinfo.h
+    COMMAND ${UPDATEREVISION_EXE} ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/hginfo.h
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
     DEPENDS updaterevision)
 
-get_target_property (NAMEDENUMS_EXE namedenums LOCATION)
-
-add_custom_target (botc_enum_strings ALL
-    COMMAND ${NAMEDENUMS_EXE} ${BOTC_HEADERS} src/enumstrings.h
+add_custom_target (enumstrings ALL
+    COMMAND ${NAMEDENUMS_EXE} ${BOTC_HEADERS}
+		${CMAKE_BINARY_DIR}/enumstrings.h
+		${CMAKE_BINARY_DIR}/enumstrings.cpp
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
     DEPENDS namedenums)
 
-add_executable (botc ${BOTC_SOURCES})
-add_dependencies(botc revision_check botc_enum_strings)
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -W -Wall")
+add_executable (botc ${BOTC_SOURCES} ${CMAKE_BINARY_DIR}/enumstrings.cpp)
+add_dependencies (botc revision_check enumstrings)
+include_directories (${CMAKE_BINARY_DIR})
+include_directories (${CMAKE_SOURCE_DIR}/src)
 
-if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
-	set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG")
+if (NOT MSVC)
+	set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -W -Wall")
+
+	if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+		set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG")
+	endif()
 endif()

mercurial